package generic10;

class InfoMess<T extends Number>
{
	private T var;

	public T getVar()
	{
		return var;
	}

	public void setVar(T var)
	{
		this.var = var;
	}
	public String toString()
	{
		return this.var.toString();
	}
}

public class GenericDemo04
{

	public static void main(String[] args)
	{
		InfoMess<Integer> info = new InfoMess<Integer>();
		info.setVar(111);
		toSay(info);//泛型类型进行引用传递时，类型必须一致
	}
	public static void toSay(InfoMess<?> info)
	{
		System.out.print(info.toString());
	}

}
